<%@ page language="java" contentType="text/html; charset=UTF-8"    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="sec"    uri="http://www.springframework.org/security/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<sec:authentication property="principal" var="currentPrincipal" scope="page" />

<fmt:setBundle basename="ApplicationMessage" />
<fmt:setLocale value="zh_CN" />

<!DOCTYPE html>
<html lang="zh-CN">
<head>

  <%@ include file="/WEB-INF/include/meta.jsp"%>
  <%@ include file="/WEB-INF/include/css.jsp"%>

</head>

<body class="ms-theme-blue">

  <%@ include file="/WEB-INF/include/header.jsp"%>
  <%@ include file="/WEB-INF/include/submenu.jsp"%>
  
  <div class="container-fluid ms-container has-ms-sidemenu">
    
    <ol class="ms-breadcrumb breadcrumb">
      <li class="active">驳运车累计行驶公里数查询</li>
    </ol>
    
    <div class="ms-content-layout">
      
      <table class="table table-hover ms-table">
        <thead>
          <tr>
            <th>序号</th>
            <th>驾驶员</th>
            <th>公司名称</th>
            <th>内部调度指令</th>
            <th>调度日期</th>
            <th>驳运车车牌</th>
            <th>起始地</th>
            <th>目的地</th>
            <th>重载公里数</th>
            <th>空载公里数</th>
            <th>行驶公里数</th>
            <th>重载工资</th>
            <th>空载工资</th>
            <th>总工资</th>
          </tr>
        </thead>
        
        <tbody>
          <c:forEach var="result" items="${result}" varStatus="status">
            <tr>
              <td>${status.count}</td>
              <td>${result.driver}</td>
              <td>${result.organizationName}</td>
              <td>${result.dispatchOrderCode}</td>
              <td>${result.dispatchDate}</td>
              <td>${result.vehicleName}</td>
              <td>${result.startFacilityName}</td>
              <td>${result.endFacilityName}</td>
              <td><fmt:formatNumber value="${result.fullLoadDistance}" pattern="0.00" /></td>
              <td><fmt:formatNumber value="${result.emptyLoadDistance}" pattern="0.00" /></td>
              <td><fmt:formatNumber value="${result.actualLoadDistance}" pattern="0.00" /></td>
              <td><fmt:formatNumber value="${result.fullSalary}" pattern="0.00" /></td>
              <td><fmt:formatNumber value="${result.emptySalary}" pattern="0.00" /></td>
              <td><fmt:formatNumber value="${result.driverSalary}" pattern="0.00" /></td>
            </tr>
          </c:forEach>
        </tbody>
        
        <tfoot>
          <tr>
            <td colspan="14" class="no-vertical-padding">
              <div class="pull-left">
                <jsp:include page="/WEB-INF/include/page.jsp">
                  <jsp:param name="url" value="${ctx.host}/reports" />
                  <jsp:param name="queryString" value="${queryString}" />
                </jsp:include>
              </div>
              
              <div class="pull-right">
                <c:if test="${page.totals > 0}">
                  <a href="${ctx.host}/reports/driver-accumulated-mileage-export?${queryString}&per_page=${config.everyPage}&page=${page.currentPage}" class="btn btn-default ms-export">输出当前记录</a>
                  <a href="${ctx.host}/reports/driver-accumulated-mileage-export?${queryString}&per_page=${config.limit}&page=1" class="btn btn-default ms-export">输出所有记录</a>
                </c:if>
              </div>
            </td>
          </tr>
        </tfoot>
      </table>

    </div> 
  </div>       
  <%@ include file="/WEB-INF/include/script.jsp"%>
</body>
</html>